package com.example.questionnairespringboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.questionnairespringboot.Req.PersonReq;
import com.example.questionnairespringboot.entity.Consumer;
import com.example.questionnairespringboot.mapper.ConsumerMapper;
import com.example.questionnairespringboot.service.IConsumerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2022-11-02
 */
@Service
public class ConsumerServiceImpl extends ServiceImpl<ConsumerMapper, Consumer> implements IConsumerService {

    public boolean login(PersonReq personReq) {
        QueryWrapper<Consumer> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("account", personReq.getAccount());
        queryWrapper.eq("password", personReq.getPassword());
        Consumer one =getOne(queryWrapper);
        return one != null;
    }
}
